﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using T.FAS.Action.MetaData.Entity;
using T.FAS.Base.Dao;
using Teld.Core.DAC.Service;
using Teld.Core.DataAccessEx.Core;

namespace T.FAS.Action.Dev.Dao
{
    public class ActionMetaDataMethodELBDao : DaoService<ActionMetaDataMethod>
    {
        public override string TableName => "FAS_ActionMetaDataMethod";
        public override string IDColumnName => "ID";
        public override List<string> ExceptColumnName
            => DaoUtil.GetExceptionColumn<ActionMetaDataMethod>(
                new List<string>
                {
                }
            );
        public ActionMetaDataMethodELBDao() : base()
        {
            DBName = "TeldFAS";
        }
        public override Dictionary<string, PropertyInfo> GetColumns()
        {
            return DaoServiceExtension.GetAllColumns<ActionMetaData>(base.GetColumns());
        }
        /// <summary>
        /// 根据Action元数据ID删除Action方法表数据
        /// </summary>
        /// <param name="actionID"></param>
        public void DeleteActionMetadataMethodByActionID(string actionID)
        {
            var parameter = DB.MakeInParam("@ActionMetaDataID",TeldDbDataType.VarChar,actionID);

            DB.ExecSqlStatement(string.Format("delete from {0} where ActionMetaDataID = @ActionMetaDataID",this.TableName), parameter);
        }
        /// <summary>
        /// 根据ActionID获取ActionMetaDataMethod数据
        /// </summary>
        /// <param name="actionID"></param>
        /// <returns></returns>
        public ActionMetaDataMethod GetActionMetaDataMethodByActionID(string actionID)
        {
            var result = base.GetObjectsByFilter($"ActionMetaDataId='{actionID}'");

            return (result == null || result.Count<=0 )? null : (result[0] as ActionMetaDataMethod);
        }

        public List<ActionMetaDataMethod> GetActionMetaDataMethodByFilter(Dictionary<string, string> filter)
        {
            throw new NotImplementedException();
        }

        public ActionMetaDataMethod GetActionMetaDataMethodByID(string methodID)
        {
            throw new NotImplementedException();
        }

        public void AddActionMetaDataMethod(ActionMetaDataMethod method)
        {
            throw new NotImplementedException();
        }

        public void UpdateActionMetaDataMethod(ActionMetaDataMethod method)
        {
            throw new NotImplementedException();
        }

        public void DeleteActionMetaDataMethod(string methodID)
        {
            throw new NotImplementedException();
        }
    }
}
